@Service
	public class PageOperateServiceImpl implements PageOperateService
	{
		@Resource
		private  PageOperateMapper  pageOperateMapper;
		@Override
		public int insertPageOperate(PageOperateParam param){
			PageOperate pageOperate = new PageOperate();
			if(param.getPageId() != 0){
				pageOperate.setPageId(param.getPageId());
			}
			if(param.getWebUrl() != null){
				pageOperate.setWebUrl(param.getWebUrl());
			}
			if(param.getRequestUrl() != null){
				pageOperate.setRequestUrl(param.getRequestUrl());
			}
			if(param.getPageOperateCode() != null){
				pageOperate.setPageOperateCode(param.getPageOperateCode());
			}
			if(param.getPageOperateName() != null){
				pageOperate.setPageOperateName(param.getPageOperateName());
			}
			if(param.getDescription() != null){
				pageOperate.setDescription(param.getDescription());
			}
			if(param.getOperateType() != 0){
				pageOperate.setOperateType(param.getOperateType());
			}
			if(param.getIsFieldOperate() != 0){
				pageOperate.setIsFieldOperate(param.getIsFieldOperate());
			}
			if(param.getRequestType() != 0){
				pageOperate.setRequestType(param.getRequestType());
			}
			if(param.getIconUrl() != null){
				pageOperate.setIconUrl(param.getIconUrl());
			}
			if(param.getCreateTime() != 0){
				pageOperate.setCreateTime(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				pageOperate.setUpdateTime(param.getUpdateTime());
			}
			 return pageOperateMapper.insertSelective(pageOperate);
		}
		@Override
		public int updatePageOperate(PageOperateEditParam param){
			PageOperate pageOperate = new PageOperate();
			if(param.getPageOperateId() != null){
				pageOperate = getPageOperate(Long.parseLong(param.getPageOperateId()));
			}
			if(pageOperate == null){
				return 0;
			}
			if(param.getPageId() != 0){
				pageOperate.setPageId(param.getPageId());
			}
			if(param.getWebUrl() != null){
				pageOperate.setWebUrl(param.getWebUrl());
			}
			if(param.getRequestUrl() != null){
				pageOperate.setRequestUrl(param.getRequestUrl());
			}
			if(param.getPageOperateCode() != null){
				pageOperate.setPageOperateCode(param.getPageOperateCode());
			}
			if(param.getPageOperateName() != null){
				pageOperate.setPageOperateName(param.getPageOperateName());
			}
			if(param.getDescription() != null){
				pageOperate.setDescription(param.getDescription());
			}
			if(param.getOperateType() != 0){
				pageOperate.setOperateType(param.getOperateType());
			}
			if(param.getIsFieldOperate() != 0){
				pageOperate.setIsFieldOperate(param.getIsFieldOperate());
			}
			if(param.getRequestType() != 0){
				pageOperate.setRequestType(param.getRequestType());
			}
			if(param.getIconUrl() != null){
				pageOperate.setIconUrl(param.getIconUrl());
			}
			if(param.getCreateTime() != 0){
				pageOperate.setCreateTime(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				pageOperate.setUpdateTime(param.getUpdateTime());
			}
			 return pageOperateMapper.updateByPrimaryKeySelective(pageOperate);
		}
		@Override
		public int deletePageOperate(long id){
			PageOperate pageOperate = getPageOperate(id);
			if(pageOperate == null){
				return 0;
			}
			return pageOperateMapper.deleteByPrimaryKey(id);
		}
		@Override
		public PageOperate getPageOperate(long id){
			 return pageOperateMapper.selectByPrimaryKey(id);
		}
		@Override
		public int deletePageOperateList(String ids){
			List<String> pageOperateList = Arrays.asList(ids.split(","));
			int count = 0;
			for (String id : pageOperateList) {
			count = count + deletePageOperate(Long.parseLong(id));
		}
			if( count == pageOperateList.size()){
			return 1;
			}else{
			return 0;
			}
	}
		@Override
		public List<PageOperate> selectPageOperate(PageOperateSelectParam param){
			PageOperateExample pageOperateExample = new PageOperateExample();
			pageOperateExample.setOrderByClause("create_time desc");
			PageOperateExample.Criteria criteria = pageOperateExample.createCriteria();
			if(param.getPageId() != 0){
				criteria.andPageIdEqualTo(param.getPageId());
			}
			if(param.getWebUrl() != null){
				criteria.andWebUrlEqualTo(param.getWebUrl());
			}
			if(param.getRequestUrl() != null){
				criteria.andRequestUrlEqualTo(param.getRequestUrl());
			}
			if(param.getPageOperateCode() != null){
				criteria.andPageOperateCodeEqualTo(param.getPageOperateCode());
			}
			if(param.getPageOperateName() != null){
				criteria.andPageOperateNameEqualTo(param.getPageOperateName());
			}
			if(param.getDescription() != null){
				criteria.andDescriptionEqualTo(param.getDescription());
			}
			if(param.getOperateType() != 0){
				criteria.andOperateTypeEqualTo(param.getOperateType());
			}
			if(param.getIsFieldOperate() != 0){
				criteria.andIsFieldOperateEqualTo(param.getIsFieldOperate());
			}
			if(param.getRequestType() != 0){
				criteria.andRequestTypeEqualTo(param.getRequestType());
			}
			if(param.getIconUrl() != null){
				criteria.andIconUrlEqualTo(param.getIconUrl());
			}
			if(param.getCreateTime() != 0){
				criteria.andCreateTimeEqualTo(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				criteria.andUpdateTimeEqualTo(param.getUpdateTime());
			}
			if (param.getOrder() != 0){
			}
			pageOperateExample.setLimitStart((param.getPageIndex() - 1) * param.getPageSize());
			pageOperateExample.setLimitEnd(param.getPageSize());
			List<PageOperate> pageOperateList = pageOperateMapper.selectByExample(pageOperateExample);
			return pageOperateList;
		}
		@Override
		public int countPageOperate(PageOperateSelectParam param){
			PageOperateExample pageOperateExample = new PageOperateExample();
			pageOperateExample.setOrderByClause("create_time desc");
			PageOperateExample.Criteria criteria = pageOperateExample.createCriteria();
			if(param.getPageId() != 0){
				criteria.andPageIdEqualTo(param.getPageId());
			}
			if(param.getWebUrl() != null){
				criteria.andWebUrlEqualTo(param.getWebUrl());
			}
			if(param.getRequestUrl() != null){
				criteria.andRequestUrlEqualTo(param.getRequestUrl());
			}
			if(param.getPageOperateCode() != null){
				criteria.andPageOperateCodeEqualTo(param.getPageOperateCode());
			}
			if(param.getPageOperateName() != null){
				criteria.andPageOperateNameEqualTo(param.getPageOperateName());
			}
			if(param.getDescription() != null){
				criteria.andDescriptionEqualTo(param.getDescription());
			}
			if(param.getOperateType() != 0){
				criteria.andOperateTypeEqualTo(param.getOperateType());
			}
			if(param.getIsFieldOperate() != 0){
				criteria.andIsFieldOperateEqualTo(param.getIsFieldOperate());
			}
			if(param.getRequestType() != 0){
				criteria.andRequestTypeEqualTo(param.getRequestType());
			}
			if(param.getIconUrl() != null){
				criteria.andIconUrlEqualTo(param.getIconUrl());
			}
			if(param.getCreateTime() != 0){
				criteria.andCreateTimeEqualTo(param.getCreateTime());
			}
			if(param.getUpdateTime() != 0){
				criteria.andUpdateTimeEqualTo(param.getUpdateTime());
			}
			if (param.getOrder() != 0){
			}
			pageOperateExample.setLimitStart((param.getPageIndex() - 1) * param.getPageSize());
			pageOperateExample.setLimitEnd(param.getPageSize());
			return pageOperateMapper.countByExample(pageOperateExample);
		}
}
